<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%String contextRoot = request.getContextPath();%>
<f:loadBundle basename="properties.messages" var="msg" />
<f:view>
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>SISDEP : Sistema de Informaci<h:outputText value="#{msg.tilde_o}" />n de Espacio P<h:outputText value="#{msg.tilde_u}" />blico</title>
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="stylesheet" href="<%=contextRoot%>/css/validationEngine.jquery.css" type="text/css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/template.css" type="text/css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/normalize.css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/uniform.css"> <!-- estilos formularios -->
	<link rel="stylesheet" href="<%=contextRoot%>/css/tipsy.css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/cuerpo.css">	
	<link rel="stylesheet" href="<%=contextRoot%>/css/richCustom.css">	
</head>
<body>
<div id="marco"> <!--inicio contenedor --> 
<div class="arriba-cuerpo"></div> <!-- Burrada pa ver borde redondo en IE -->
<div class="cuerpo">
<a href="<%=contextRoot%>/index.jsf"><img src="<%= contextRoot %>/images/logos.png" /></a>
<div class="clear"></div>
<!-- Menu y Usuario init() -->
	<%@ include file="include/menuUsuario.jsp" %>
<!-- Menu y Usuario end() -->
<div class="clear"></div>
<!-- Formulario --> 
<div id="buscador">
<h2>Gesti<h:outputText value="#{msg.tilde_o}" />n de Citas: NUEVO</h2>
<h:form id="createCitacionForm">
					    <span class="left" style="margin-left:5px">
						<label>C<h:outputText value="#{msg.tilde_o}" />digo <span class="asterisco">*</span></label>
							<h:inputText id="codigo" size="4" maxlength="4" styleClass="validate[required,minSize[4]]"
										value="#{citacionController.citacion.codigo}" />
						</span>	
						<span class="left" style="margin-left:50px">
						<label>Estado <span class="asterisco">*</span></label>							
						<h:selectOneMenu id="estado" styleClass="validate[required]"
								value="#{citacionController.citacion.estado}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>
                                <f:selectItem itemLabel="Programada" itemValue="PROGRAMADA"/>
                                <f:selectItem itemLabel="Llevada a Cabo" itemValue="LLEVADA_A_CABO"/>                                                                                              
                            </h:selectOneMenu>	
                        </span>
                        <div class="clear"></div>
                        <br/>
						<span class="left">
						<label>Lugar de Citaci<h:outputText value="#{msg.tilde_o}" />n <span class="asterisco">*</span></label>
							<h:selectOneMenu id="idCitacionLugar" styleClass="validate[required]" value="#{citacionController.citacion.idCitacionLugarStr}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>                                
                                <f:selectItems value="#{masterListCache.citationPlacesList}"/>
                            </h:selectOneMenu>
						</span>
						<span class="left" style="margin-left:40px">
						<label>Fecha de Citaci<h:outputText value="#{msg.tilde_o}" />n <span class="asterisco">*</span></label>						
							<h:inputText id="fechaCita" styleClass="validate[required,custom[date]] fechaCita" size="10" maxlength="10"
									value="#{citacionController.citacion.fecha}">
								<f:convertDateTime pattern="dd/MM/yyyy"/>
							</h:inputText>							
						</span>
						<span class="left" style="margin-left:40px">
						<label>Hora de Citaci<h:outputText value="#{msg.tilde_o}" />n<span class="asterisco">*</span></label>
							<h:selectOneMenu id="horaVisita" styleClass="validate[required]"
								value="#{citacionController.citacion.hora}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>
                                <f:selectItem itemLabel="00:00" itemValue="00:00"/>
                                <f:selectItem itemLabel="01:00" itemValue="01:00"/>
                                <f:selectItem itemLabel="02:00" itemValue="02:00"/>
                                <f:selectItem itemLabel="03:00" itemValue="03:00"/>
                                <f:selectItem itemLabel="04:00" itemValue="04:00"/>
                                <f:selectItem itemLabel="05:00" itemValue="05:00"/>
                                <f:selectItem itemLabel="06:00" itemValue="06:00"/>
                                <f:selectItem itemLabel="07:00" itemValue="07:00"/>
                                <f:selectItem itemLabel="08:00" itemValue="08:00"/>
                                <f:selectItem itemLabel="09:00" itemValue="09:00"/>
                                <f:selectItem itemLabel="10:00" itemValue="10:00"/>
                                <f:selectItem itemLabel="11:00" itemValue="11:00"/>
                                <f:selectItem itemLabel="12:00" itemValue="12:00"/>
                                <f:selectItem itemLabel="13:00" itemValue="13:00"/>
                                <f:selectItem itemLabel="14:00" itemValue="14:00"/>
                                <f:selectItem itemLabel="15:00" itemValue="15:00"/>
                                <f:selectItem itemLabel="16:00" itemValue="16:00"/>
                                <f:selectItem itemLabel="17:00" itemValue="17:00"/>
                                <f:selectItem itemLabel="18:00" itemValue="18:00"/>
                                <f:selectItem itemLabel="19:00" itemValue="19:00"/>
                                <f:selectItem itemLabel="20:00" itemValue="20:00"/>
                                <f:selectItem itemLabel="21:00" itemValue="21:00"/>
                                <f:selectItem itemLabel="22:00" itemValue="22:00"/>
                                <f:selectItem itemLabel="23:00" itemValue="23:00"/>
               				</h:selectOneMenu> 											
						</span>
						<div class="clear"></div>
						<br/>
						<span class="left" >
						<label>Tipo Identificaci<h:outputText value="#{msg.tilde_o}" />n<span class="asterisco">*</span></label>							
							<h:selectOneMenu id="idTipoIdentificacionStr" styleClass="validate[required]" value="#{citacionController.citacion.idTipoDocumentoStr}">
								<f:selectItem itemLabel="Seleccione..." itemValue=""/>
								<f:selectItems value="#{masterListCache.classIdentificationForFilingType}"/>
				            </h:selectOneMenu>
						</span>			
						<span class="left" style="margin-left: 100px;">
						<label>Identificaci<h:outputText value="#{msg.tilde_o}" />n<span class="asterisco">*</span></label> 
							<h:inputText id="identificacion" size="20" maxlength="20"
							styleClass="validate[required]" value="#{citacionController.citacion.documentoPersona}" />
						</span>						
						<span class="left" style="margin-left: 10px;">
						<label> &nbsp; </label> 
							<a4j:commandButton id="checkPersonaButton"											 
							                 type="submit" 
							                 value="Verificar..." ajaxSingle="true" 
							                 ondblclick="return false;" reRender="checkPersonaPanel"
					                         action="#{citacionController.checkPersonaRegistrada}" >
					                         <a4j:actionparam name="tipoIdentificacionParam" value="document.getElementById('createCitacionForm:idTipoIdentificacionStr').value" 
					                                          assignTo="#{citacionController.citacion.idTipoDocumentoStr}" noEscape="true" />
					                         <a4j:actionparam name="identificacionParam" value="document.getElementById('createCitacionForm:identificacion').value" 
					                                          assignTo="#{citacionController.citacion.documentoPersona}" noEscape="true" />
							</a4j:commandButton>
						</span>	
						<div class="clear" style="margin-left: 400px;"></div>

						<span class="left" style="margin-left:0px"><label>
						<a4j:outputPanel id="checkPersonaPanel" layout="block" >
							<h:panelGrid columns="1" style="text-align: left; width: 400px;" styleClass="tablapaginacion" >
							<h:outputText value="Persona Registrada: #{citacionController.personaLocal.primerNombre}    #{citacionController.personaLocal.segundoNombre}    #{citacionController.personaLocal.primerApellido}    #{citacionController.personaLocal.segundoApellido}" />
	                        </h:panelGrid>
                        </a4j:outputPanel>
                        </label>
						</span>							
						<div class="clear"></div>
						<br/>
						<span class="left" style="display: none">
						<label>Asisti<h:outputText value="#{msg.tilde_o}" /> </label>
								<h:selectBooleanCheckbox id="asiste" 
										value="#{citacionController.citacion.asisteChk}" />
						</span>
						<span class="left" style="display: none"> 
						<label>Reincidente </label>
								<h:selectBooleanCheckbox id="reincidente" 
										value="#{citacionController.citacion.reincidenteChk}" />
						</span>
						<span class="left" style="display: none">
						<label>Pag<h:outputText value="#{msg.tilde_o}" /> Multa </label>
								<h:selectBooleanCheckbox id="pagoMulta"
										value="#{citacionController.citacion.pagoMultaChk}" />
						</span>
						<span class="left" style="display: none">
						<label>Valor Multa</label>
								<h:inputText id="valorMulta" size="9" maxlength="9" styleClass="validate[custom[integer]"
										value="#{citacionController.citacion.valorMultaStr}" />
						</span>
						<div class="clear"></div>
						<br/>
						<span class="left">
						<label>Observaci<h:outputText value="#{msg.tilde_o}" />n <span class="asterisco">*</span></label>
							<h:inputTextarea id="observacion" styleClass="validate[required,maxSize[255]]"
							style="width:550px !important; min-width:550px !important; max-width:550px !important; height:60px !important; min-height:60px !important; max-height:60px !important; "
										value="#{citacionController.citacion.observacion}" />
						</span>

		<br/>
		<br/>
		<br/>
		<div class="clear"></div>
		(<span class="asterisco"> * </span>) : Campo Obligatorio
		<div class="clear"></div>
		<span class="botones right">
		<h:commandButton id="createCitacionButton"
		                 type="submit" 
		                 value="Guardar" 
		                 ondblclick="return false;" 
		                 action="#{citacionController.create}" >
		</h:commandButton>
		</span>
</h:form>
</div>
<!-- Fin formulario --> 
<div class="clear"></div>

	<!-- tabla --> 

	<table width="100%" cellspacing="0">  
		<thead>
	  	<tr>
			<th class="Corner">
		    	Informaci<h:outputText value="#{msg.tilde_o}" />n de Auditor<h:outputText value="#{msg.tilde_i}" />a
	    	</th>
	  	</tr>
		</thead>
		<tbody>
		  <tr class="odd">
			<td>Usuario Creaci<h:outputText value="#{msg.tilde_o}" />n</td>
			<td>Fecha Creaci<h:outputText value="#{msg.tilde_o}" />n</td>
			<td>Usuario <h:outputText value="#{msg.tilde_u}" />ltima Modificaci<h:outputText value="#{msg.tilde_o}" />n</td>
			<td>Fecha <h:outputText value="#{msg.tilde_u}" />ltima Modificaci<h:outputText value="#{msg.tilde_o}" />n</td>
		  </tr>					
		  <tr>
			<td>
			   <h:outputText value="#{citacionController.citacion.usuarioCrea}" />
			</td>
			<td>
			   <h:outputText value="#{citacionController.citacion.fechaCrea}" />
			</td>
			<td>
			   <h:outputText value="#{citacionController.citacion.usuarioModifica}" />
			</td>
			<td>
			   <h:outputText value="#{citacionController.citacion.fechaModifica}" />
			</td>						
		  </tr>	  
		</tbody>
	</table>

  	<table width="100%" cellspacing="0">				  
	  <tr>
		<td align="center" valign="bottom">
		    <h:form id="cancelManageTypeForm">
			<h:commandButton id="cancelCreateCitacionButton"
                             type="submit" 
                             value="Cancelar" 
                             ondblclick="return false;" 
                             action="#{citacionController.cancelCitacion}" >
            </h:commandButton>
            </h:form>
		</td>
	 </tr>
	</table>

<div class="abajo-cuerpo"></div> <!-- Burrada pa ver borde redondo en IE -->
</div> <!-- Fin contenedor -->
<div class="footer"></div>
<script src="<%=contextRoot%>/js/jquery/lib/jquery-1.7.2.min.js"></script><!-- De ser 1ro -->
	<script src="<%=contextRoot%>/js/script.js" type="text/javascript"></script><!-- De ser 2do -->
	<script src="<%=contextRoot%>/js/jquery/lib/jquery.uniform.min.js"></script> <!-- formularios --> 
	<script src="<%=contextRoot%>/js/jquery/lib/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=contextRoot%>/js/jquery/lib/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=contextRoot%>/js/jquery/lib/jquery.tipsy.js" type="text/javascript"></script> <!-- Tooltip -->
	<script src="<%=contextRoot%>/js/jquery.maskedinput-1.3.js" type="text/javascript"></script>
	<script type="text/javascript">
	jQ(document).ready(function() {
		jQ("input, select, input:checkbox, input:radio, input:file").uniform();
		jQ("#createCitacionForm").validationEngine('attach');
		jQ("#createCitacionForm").bind("jqv.form.result", function(event, errorFound) {
	        if(!errorFound) displayLoadingImage();
	    });
    	jQ('#accesos li a').tipsy({gravity: 'n'});
    	jQ(".fechaCita").mask("99/99/9999");
	});
	</script>
	<%@ include file="include/validationStatus.jsp" %>
	<%@ include file="include/modalMessageWindow.jsp" %>
</body>
</html>
</f:view>

